/** 
 * @description: Solve the problem of Hanoi
 * @function name: Hanoi()
 * @param: three char and one integer
 * @author timlentse(tinglenxan@gmail.com)
 * @Date: 2014-10-31
 */
#include <iostream>
using namespace std ;
void move(const char from,int n, const char to){
cout << "Move Dish "<< n <<" from "<<" pillar"<< from <<" to pillar "<< to << endl;
}
void Hanoi ( int n, const char pillar_a, const char pillar_b, const char pillar_c) {
    if (n==0) {
        cout << "nothing need to be done!" << endl; }
        else if (n==1) {
         move (pillar_a, 1,   pillar_c);
        }
    else {
        Hanoi(n-1, pillar_a, pillar_c, pillar_b);
        move (pillar_a, n,   pillar_c);
        Hanoi(n-1, pillar_b, pillar_a, pillar_c);
    }
        }
int main(int argc, char* argv[])
{
    int n=0;
    cin>> n;
    const char x= '1',y='2',z='3';
    Hanoi(n,x,y,z);
    return 0;
}
